package com.whuan.student.repository;

import com.whuan.student.dataObject.Student;
import com.whuan.student.dataObject.User;
import com.whuan.student.dto.UserDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student,String> {

    /*查询班级现有成员*/
    List<Student> findByUpclass(Integer upclass);

    Page<Student> findByUpclass(Integer upclass, Pageable pageable);

    @Query(value = "select u.id,u.name,u.password ,u.sex from student u where u.name=?1", nativeQuery = true)
    List<Object> findByName(String name);

}
